package elitech.vietnam.copyweatherfashion.entities;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

import com.google.gson.annotations.SerializedName;


public class Product {

	@SerializedName("id")
	public int Id;
	
	@SerializedName("id_post")
	public int PostId;
	
	@SerializedName("title")
	public String Title;
	
	@SerializedName("price")
	public double Price;
	
	@SerializedName("image")
	public String Image;
	
	@SerializedName("link")
	public String Link;
	
	@SerializedName("status")
	public int Status;
	
	@SerializedName("create_day")
	public String CreateDate;
	
	public Date CreateDate() {
		try {
			return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()).parse(CreateDate);
		} catch (ParseException e) {
			e.printStackTrace();
			return null;
		}
	}
}
